<script >
export default {
  data() {
    return {
msg:'hi'
    }
  },
  watch: {
    // 每当 question 改变时，这个函数就会执行
    msg(newQuestion, oldQuestion) {
      console.log('数据改变'+newQuestion,oldQuestion);
    }
  }
}

</script>

<template>  
<input type="button" @click="msg='你好'" value="点击">
{{ msg }}

</template>

<style scoped>

</style>
